from System.Collections.Generic import List
from System import Byte, Int32

bosslist = ['The Gravedigger','Flea','A Pumpkin Lord','A Costumed Orc Champion','Peinsluth','Jack The Ripper','Franquistang','Uncle Fester','The Guardian','Clawser','Clawser Jr','A Noxious Gas Cloud','A Steaming Heap','Britomartis','Araneam','Wraith High Priest','Freddy Krueger','Britomartis','Lady Britomartis','Medusa','Creature Of The Night','Headless Horseman','Killer Dolphin']
YueQIsz = [0x2805,0x0E9E,0x0E9D,0x0EB3,0x0E9C,0x0EB2]


def findboss():
    YBoss = False
    efilter = Mobiles.Filter()
    efilter.Enabled = True
    efilter.Notorieties = List[Byte](bytes([3,4,5,6]))  
#    efilter.Bodies = List[Int32]([0x0053,0x001E,0x02D5,0x0049,0x0111,0x010B])    
    bosses = Mobiles.ApplyFilter(efilter) 
    if len(bosses)>0:
        for boss in bosses:
            name = Mobiles.GetPropStringByIndex(boss,0)
            if name.strip() in bosslist:
                YBoss = True
                break
        return(YBoss)
    else:
        return(False)

def GetBoss():    
    fBoss = None
    efilter = Mobiles.Filter()
    efilter.Enabled = True
    efilter.Notorieties = List[Byte](bytes([3,4,5,6]))  
    #efilter.Bodies = List[Int32]([0x0053,0x001E,0x02D5,0x0049,0x0111,0x010B])    
    bosses = Mobiles.ApplyFilter(efilter) 
    if len(bosses)>0:
        for boss in bosses:
            name = Mobiles.GetPropStringByIndex(boss,0)
            if name.strip() in bosslist:
                fBoss = boss
                break
        return(fBoss)
    else:
        return(False)

def findenemy():
    efilter = Mobiles.Filter()
    efilter.Enabled = True
    #efilter.Warmode = 1
    #efilter.Friend = 0
    efilter.Bodies = List[Int32]([0x00BD,0x013D,0x02E4,0x0053,0x0007,0x00B6,0x02D5,0x02D7,0x00C7,0x0533,0x0051])
    efilter.Notorieties = List[Byte](bytes([3,4,5,6]))
    
    enemies = Mobiles.ApplyFilter(efilter)
    if len(enemies)>0:
        return enemies
    else:
        return False
        
while True:
    CF = findboss()
    if CF:
        enemy = None
        GDBoss = GetBoss()
        enemies = findenemy()
        if enemies:
            while True:
                enemy = Mobiles.Select(enemies,'Nearest')
                if enemy != GDBoss:
                    break
            
        quanbuwupin = Player.Backpack.Contains
        for wuping in quanbuwupin:
            if wuping.ItemID in YueQIsz: 
                YQ = wuping.ItemID
                break
                    
        Items.UseItemByID(YQ,-1)       
        Misc.Pause(1000)
        Player.UseSkill("Provocation")
        Target.WaitForTarget(10000, False)
        Target.TargetExecute(enemy)
        Mobiles.Message(enemy,38,'被煽动者')
        Target.WaitForTarget(10000, False)
        Target.TargetExecute(GDBoss)
        Mobiles.Message(GDBoss,48,'被攻击者')
        Misc.Pause(8000)    
            
        